/** @file gui_group.h
    @brief A groupbox widget */

#ifndef G3_GUI_GROUP_H
#define G3_GUI_GROUP_H

#include "gui/gui_label.h"

namespace G3 {
namespace GUI {

/** @class GROUP
    @brief A groupbox widget class */
class GROUP: public WIDGET {
	public:
        /**
            @brief A constructor
        */
		GROUP ();

        /**
            @brief A destructor
        */
		virtual ~GROUP () {
			FrameVisible = false;
		}

        /** The color of the groupbox */
		COL4F Color;
		/** Is the frame visible ? */
		bool FrameVisible;

		GROUP& operator= (const GROUP &aGroup);

        /**
            @brief Creates the group
            @param[in] aRect Reference to the group rectangle
            @param[in] aFont Pointer to the caption font
            @param[in] aTitle Reference to the title string
        */
		void Create (const RECTI &aRect, FONT *aFont = NULL, const std::string &aTitle = "");

        /**
            @brief Sets group dimensions
            @param[in] aRect Reference to the new rectangle
        */
		void SetRect (const RECTI &aRect);

        /**
            @brief Attaches a font to the group title
            @param[in] aFont pointer to the new font
        */
		void AttachFont (FONT *aFont);

        /**
            @brief Sets the caption of the group label
            @param[in] aCaption Reference to the new caption string
        */
		void SetCaption (const string &aCaption);

        /**
            @brief Shows the frame
        */
		void ShowFrame () { FrameVisible = true; }
        /**
            @brief Hides the frame
        */
		void HideFrame () { FrameVisible = false; }

        /**
            @brief Draws the group
            @param[in] aElapsedTime The elapsed time since the last call
        */
		void Draw (float aElapsedTime = 0.0f);

        /**
            @brief Gets the type of this widget
            @return The type index \see TYPE_MANAGER
        */
		virtual uint GetType () { return MainTypeMgr.GetType ("W_GROUP"); }

        /**
            @brief Is this widget static ?
            @return True.
        */
		virtual bool IsStatic () { return true; }
};

}
}

#endif // G3_GUI_GROUP_H
